package com.wejoy.video.middle.station.api.filter;

import com.alibaba.fastjson.JSON;
import com.google.common.base.Throwables;
import com.wejoy.video.middle.station.api.annotation.LoginCheck;
import com.wejoy.video.middle.station.api.annotation.SignatureAuth;
import com.wejoy.video.middle.station.data.domain.system.SysUser;
import com.wejoy.video.middle.station.data.util.LoginUtil;
import com.wejoy.video.middle.station.data.util.StringUtils;
import com.wejoy.video.middle.station.data.vo.RespJSON;
import com.wejoy.video.middle.station.data.vo.ReturnCode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.MethodParameter;
import org.springframework.core.annotation.Order;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * 登录过滤器
 * 用于将登录信息放到session中
 **/
@Order(1004)
@Configuration
public class SignFilter implements HandlerInterceptor {
    private final static Logger logger = LoggerFactory.getLogger(SignFilter.class);

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {

        HandlerMethod handlerMethod = (HandlerMethod) handler;
        SignatureAuth methodAnnotation = handlerMethod.getMethodAnnotation(SignatureAuth.class);
        return true;
    }
}
